1
2 Imports System.Security.AccessControl
3 Imports System.IO
4
5 Public Class frmMain
6
7     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
8         MsgBox(
"Thank you For Using This Software Develop By S.A Computers", MsgBoxStyle.Information)
9         Application.Exit()
10     End Sub
11
12     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
13         GroupBox1.Visible = True
14         GroupBox2.Visible = False
15         GroupBox3.Visible = False
16         GroupBox4.Visible = False
17         Panel2.Visible = False
18         Panel3.Visible = False
19     End Sub
20
21     Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
22         Me.WindowState = FormWindowState.Minimized
23     End Sub
24
25     Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
26         OpenFileDialog1.ShowDialog()
27         TextBox1.Text = OpenFileDialog1.FileName
28     End Sub
29
30     Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
31         MsgBox(
"Make sure you run as administartor", MsgBoxStyle.Information)
32         If TextBox1.Text =
"" Then
33             MsgBox(
"Please select an icon.", MsgBoxStyle.Exclamation)
34         End If
35         If ComboBox1.SelectedItem =
"" Then
36             MsgBox(
"Please select a drive letter.", MsgBoxStyle.Exclamation)
37         Else
38             My.Computer.Registry.CurrentUser.CreateSubKey(
"Software\\Classes\\Applications\\Explorer.exe\\Drives" & "\\" & ComboBox1.SelectedItem & "\\" & "DefaultIcon")
39             My.Computer.Registry.SetValue(
"HKEY_CURRENT_USER\Software\Classes\Applications\Explorer.exe\Drives\" & ComboBox1.SelectedItem & "\" & "DefaultIcon", "", TextBox1.Text, Microsoft.Win32.RegistryValueKind.String)
40             MsgBox("
Icon changed successfully!", MsgBoxStyle.Information)
41         End If
42     End Sub
43
44     Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
45         GroupBox1.Visible = False
46     End Sub
47
48     Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
49         With FolderBrowserDialog1
50             If .ShowDialog() = Windows.Forms.DialogResult.OK Then
51                 TextBox2.Text = .SelectedPath
52
53             End If
54         End With
55     End Sub
56
57     Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
58         If TextBox2.Text = "" Then
59             MsgBox("
Select Folder Path")
60         Else
61             Dim fs As FileSystemSecurity = File.GetAccessControl(TextBox2.Text)
62             fs.AddAccessRule(New FileSystemAccessRule(Environment.UserName, FileSystemRights.FullControl, AccessControlType.Deny))
63             File.SetAccessControl(TextBox2.Text, fs)
64             MsgBox("
Folder Lock ")
65             Application.Exit()
66         End If
67     End Sub
68
69     Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
70         If TextBox2.Text = "" Then
71             MsgBox("
Select Folder Path")
72         Else
73             Dim fs As FileSystemSecurity = File.GetAccessControl(TextBox2.Text)
74             fs.RemoveAccessRule(New FileSystemAccessRule(Environment.UserName, FileSystemRights.FullControl, AccessControlType.Deny))
75             File.SetAccessControl(TextBox2.Text, fs)
76             MsgBox("
Folder Unlock ")
77             Application.Exit()
78         End If
79     End Sub
80
81     Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
82         GroupBox2.Visible = False
83     End Sub
84
85     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
86         GroupBox1.Visible = False
87         GroupBox2.Visible = True
88         GroupBox3.Visible = False
89         GroupBox4.Visible = False
90         Panel2.Visible = False
91         Panel3.Visible = False
92     End Sub
93
94     Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
95         With FolderBrowserDialog1
96             If .ShowDialog() = Windows.Forms.DialogResult.OK Then
97                 TextBox3.Text = .SelectedPath
98
99             End If
100         End With
101     End Sub
102
103     Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
104         If TextBox3.Text = "" Then
105             MsgBox("
select File")
106         Else
107             IO.File.SetAttributes(TextBox3.Text, IO.FileAttributes.Hidden)
108             MsgBox("
Sucessfully hide")
109         End If
110     End Sub
111
112     Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
113         If TextBox4.Text = "" Then
114             MsgBox("
select Path...")
115         Else
116             IO.File.SetAttributes(TextBox4.Text, IO.FileAttributes.Normal)
117             MsgBox("
Unhide Successfully..")
118         End If
119     End Sub
120
121     Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click
122         With FolderBrowserDialog1
123             If .ShowDialog() = Windows.Forms.DialogResult.OK Then
124                 TextBox4.Text = .SelectedPath
125
126             End If
127         End With
128     End Sub
129
130     Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
131         If TextBox2.Text = "" Then
132             MsgBox("
select Path..")
133         Else
134             IO.File.SetAttributes(TextBox2.Text, IO.FileAttributes.Directory)
135             MsgBox("
hide Sucssfully..")
136         End If
137     End Sub
138
139     Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
140         If TextBox4.Text = "" Then
141             MsgBox("
Select Path")
142         Else
143             IO.File.SetAttributes(TextBox4.Text, IO.FileAttributes.Normal)
144             MsgBox("
Unhide Successfully..")
145         End If
146     End Sub
147
148     Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
149         Panel3.Hide()
150     End Sub
151
152     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
153         GroupBox1.Visible = False
154         GroupBox2.Visible = False
155         GroupBox3.Visible = True
156         GroupBox4.Visible = True
157         Panel2.Visible = True
158         Panel3.Visible = False
159     End Sub
160
161     Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
162         GroupBox1.Visible = False
163         GroupBox2.Visible = False
164         GroupBox3.Visible = False
165         GroupBox4.Visible = False
166         Panel2.Visible = False
167         Panel3.Visible = True
168     End Sub
169
170     Private Sub Label16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label16.Click
171
172     End Sub
173
174     Private Sub Label15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label15.Click
175
176     End Sub
177
178     Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
179         GroupBox1.Visible = False
180         GroupBox2.Visible = False
181         GroupBox3.Visible = False
182         GroupBox4.Visible = False
183         Panel2.Visible = False
184         Panel3.Visible = False
185         frmCngPass.ShowDialog()
186     End Sub
187 End Class


Gõ tìm kiếm nhanh...